<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyPetStore</title>
    <link rel="Stylesheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<div th:replace="common/top">
</div>

<div id="Content">
    <div id="BackLink">
        <a href="main">Return to Main Menu</a>
    </div>

    <div id="Catalog">

        <h2 th:text="${category.name}">Category的name属性</h2>
        <!-- 用sessionScope将该请求的查询结果(某个对象)的属性值放到session里面，使其在一个对话周期内能够保存-->
        <!--查询两类：category的类型以及product-->
        <table>
            <tr>
                <th >Product ID</th>
                <th >Name</th>
            </tr>

            <tr th:each="product:${productList}">
                <td id="td1">
                    <a id="aaa" th:href="@{'/catalog/product?productId='+${product.productId}}" th:text="${product.productId}">productId</a>
                </td>
                <td id="td2" th:text="${product.name}">Product Name</td>
            </tr>
        </table>

    </div>
</div>

<div th:replace="common/bottom">
</div>
</body>
</html>